Реализация интерпретатора выражений и обновление документации и версии до 0.0.3#20
Merged
netkeep80 merged 3 commits intonetkeep80:mainfrom Feb 6, 2026
Merged
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: netkeep80#16
…и до 0.0.3 Добавлен интерпретатор логических выражений interpret() для вычисления выражений из JSON в МАО с поддержкой NOT, AND, OR и вложенных выражений. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 47aa80a.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Реализация следующей задачи в текущей фазе разработки (Фаза 2: Функциональность) — интерпретатор логических выражений из JSON в МАО.
Fixes #16
Что реализовано
1. Интерпретатор выражений
interpret()(src/main.cpp)true,false,null— примитивные значения{"Not": [expr]}— логическое НЕ (унарный оператор){"And": [expr1, expr2]}— логическое И (бинарный оператор){"Or": [expr1, expr2]}— логическое ИЛИ (бинарный оператор){"Not": [{"And": [true, false]}]}=NOT[AND[True][False]]=True2. Функция
resolve_operator()(src/main.cpp)"Not"→Not,"And"→And,"Or"→Or3. Интеграция в CLI (
src/main.cpp)interpret()вместоimport_json()4. Модульные тесты (
test/unit_test.cpp)NOT[AND[...]],NOT[OR[...]],AND[NOT[...], NOT[...]],OR[NOT[...], NOT[...]](4 проверки)NOT[NOT[...]], трёхуровневые выражения (4 проверки)5. Тестовые JSON-файлы
test/expr_not.json—{"Not": [true]}→falsetest/expr_and.json—{"And": [true, false]}→falsetest/expr_or.json—{"Or": [false, true]}→truetest/expr_nested.json—{"Not": [{"And": [true, false]}]}→true6. Обновление документации
Принцип работы
Интерпретатор
interpret()рекурсивно обрабатывает JSON-выражения:Файлы изменены
src/main.cpp— добавленыresolve_operator(),interpret(), интеграция вmain()(+95 строк)test/unit_test.cpp— 26 новых тестов (+116 строк)test/expr_not.json,test/expr_and.json,test/expr_or.json,test/expr_nested.json— новые тестовые файлыCMakeLists.txt— версия 0.0.3README.md— обновлены Features, Status, Usageanalysis.md— обновлены слабые стороны, метрики и оценка зрелостиplan.md— отмечены завершённые задачиTest plan
🤖 Generated with Claude Code